home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / bison.arc / BISON.SIM < prev    next >
Text File  |  1988-07-11  |  15KB  |  504 lines

  1. #line 2 "bison.simple"
  2.  
  3. /* Skeleton output parser for bison,
  4.    copyright (C) 1984 Bob Corbett and Richard Stallman
  5.  
  6.                NO WARRANTY
  7.  
  8.   BECAUSE THIS PROGRAM IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
  9. NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW.  EXCEPT
  10. WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC,
  11. RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE THIS PROGRAM "AS IS"
  12. WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
  13. BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  14. FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY
  15. AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE
  16. DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
  17. CORRECTION.
  18.  
  19.  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
  20. STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY
  21. WHO MAY MODIFY AND REDISTRIBUTE THIS PROGRAM AS PERMITTED BELOW, BE
  22. LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR
  23. OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  24. USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
  25. DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR
  26. A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) THIS
  27. PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
  28. DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
  29.  
  30.         GENERAL PUBLIC LICENSE TO COPY
  31.  
  32.   1. You may copy and distribute verbatim copies of this source file
  33. as you receive it, in any medium, provided that you conspicuously and
  34. appropriately publish on each copy a valid copyright notice "Copyright
  35. (C) 1985 Free Software Foundation, Inc."; and include following the
  36. copyright notice a verbatim copy of the above disclaimer of warranty
  37. and of this License.  You may charge a distribution fee for the
  38. physical act of transferring a copy.
  39.  
  40.   2. You may modify your copy or copies of this source file or
  41. any portion of it, and copy and distribute such modifications under
  42. the terms of Paragraph 1 above, provided that you also do the following:
  43.  
  44.     a) cause the modified files to carry prominent notices stating
  45.     that you changed the files and the date of any change; and
  46.  
  47.     b) cause the whole of any work that you distribute or publish,
  48.     that in whole or in part contains or is a derivative of this
  49.     program or any part thereof, to be licensed at no charge to all
  50.     third parties on terms identical to those contained in this
  51.     License Agreement (except that you may choose to grant more
  52.     extensive warranty protection to third parties, at your option).
  53.  
  54.     c) You may charge a distribution fee for the physical act of
  55.     transferring a copy, and you may at your option offer warranty
  56.     protection in exchange for a fee.
  57.  
  58.   3. You may copy and distribute this program or any portion of it in
  59. compiled, executable or object code form under the terms of Paragraphs
  60. 1 and 2 above provided that you do the following:
  61.  
  62.     a) cause each such copy to be accompanied by the
  63.     corresponding machine-readable source code, which must
  64.     be distributed under the terms of Paragraphs 1 and 2 above; or,
  65.  
  66.     b) cause each such copy to be accompanied by a
  67.     written offer, with no time limit, to give any third party
  68.     free (except for a nominal shipping charge) a machine readable
  69.     copy of the corresponding source code, to be distributed
  70.     under the terms of Paragraphs 1 and 2 above; or,
  71.  
  72.     c) in the case of a recipient of this program in compiled, executable
  73.     or object code form (without the corresponding source code) you
  74.     shall cause copies you distribute to be accompanied by a copy
  75.     of the written offer of source code which you received along
  76.     with the copy you received.
  77.  
  78.   4. You may not copy, sublicense, distribute or transfer this program
  79. except as expressly provided under this License Agreement.  Any attempt
  80. otherwise to copy, sublicense, distribute or transfer this program is void and
  81. your rights to use the program under this License agreement shall be
  82. automatically terminated.  However, parties who have received computer
  83. software programs from you with this License Agreement will not have
  84. their licenses terminated so long as such parties remain in full compliance.
  85.  
  86.   5. If you wish to incorporate parts of this program into other free
  87. programs whose distribution conditions are different, write to the Free
  88. Software Foundation at 675 Mass Ave, Cambridge, MA 02139.  We have not yet
  89. worked out a simple rule that can be stated here, but we will often permit
  90. this.  We will be guided by the two goals of preserving the free status of
  91. all derivatives of our free software and of promoting the sharing and reuse of
  92. software.
  93.  
  94.  
  95. In other words, you are welcome to use, share and improve this program.
  96. You are forbidden to forbid anyone else to use, share and improve
  97. what you give them.   Help stamp out software-hoarding!  */
  98.  
  99. /* This is the parser code that is written into each bison parser
  100.   when the %semantic_parser declaration is not specified in the grammar.
  101.   It was written by Richard Stallman by simplifying the hairy parser
  102.   used when %semantic_parser is specified.  */
  103.  
  104. /* Note: there must be only one dollar sign in this file.
  105.    It is replaced by the list of actions, each action
  106.    as one case of the switch.  */
  107.  
  108. #define yyerrok        (yyerrstatus = 0)
  109. #define yyclearin    (yychar = YYEMPTY)
  110. #define YYEMPTY        -2
  111. #define YYEOF        0
  112. #define YYFAIL        goto yyerrlab;
  113.  
  114. #define YYTERROR    1
  115.  
  116. #ifndef YYIMPURE
  117. #define YYLEX        yylex()
  118. #endif
  119.  
  120. #ifndef YYPURE
  121. #define YYLEX        yylex(&yylval, &yylloc)
  122. #endif
  123.  
  124. /* If nonreentrant, generate the variables here */
  125.  
  126. #ifndef YYIMPURE
  127.  
  128. int    yychar;            /*  the lookahead symbol        */
  129. YYSTYPE    yylval;            /*  the semantic value of the        */
  130.                 /*  lookahead symbol            */
  131.  
  132. YYLTYPE yylloc;            /*  location data for the lookahead    */
  133.                 /*  symbol                */
  134.  
  135. int yydebug = 0;        /*  nonzero means print parse trace    */
  136.  
  137. #endif  /* YYIMPURE */
  138.  
  139.  
  140. /*  YYMAXDEPTH indicates the initial size of the parser's stacks    */
  141.  
  142. #ifndef    YYMAXDEPTH
  143. #define YYMAXDEPTH 200
  144. #endif
  145.  
  146. /*  YYMAXLIMIT is the maximum size the stacks can grow to
  147.     (effective only if the built-in stack extension method is used).  */
  148.  
  149. #ifndef YYMAXLIMIT
  150. #define YYMAXLIMIT 10000
  151. #endif
  152.  
  153.  
  154. #line 87 "bison.simple"
  155. int
  156. yyparse()
  157. {
  158.   register int yystate;
  159.   register int yyn;
  160.   register short *yyssp;
  161.   register YYSTYPE *yyvsp;
  162.   YYLTYPE *yylsp;
  163.   int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  164.   int yychar1;        /*  lookahead token as an internal (translated) token number */
  165.  
  166.   short    yyssa[YYMAXDEPTH];    /*  the state stack            */
  167.   YYSTYPE yyvsa[YYMAXDEPTH];    /*  the semantic value stack        */
  168.   YYLTYPE yylsa[YYMAXDEPTH];    /*  the location stack            */
  169.  
  170.   short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  171.   YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to reallocate them elsewhere */
  172.   YYLTYPE *yyls = yylsa;
  173.  
  174.   int yymaxdepth = YYMAXDEPTH;
  175.  
  176. #ifndef YYPURE
  177.  
  178.   int yychar;
  179.   YYSTYPE yylval;
  180.   YYLTYPE yylloc;
  181.  
  182.   extern int yydebug;
  183.  
  184. #endif
  185.  
  186.  
  187.   YYSTYPE yyval;        /*  the variable used to return        */
  188.                 /*  semantic values from the action    */
  189.                 /*  routines                */
  190.  
  191.   int yylen;
  192.  
  193.   if (yydebug)
  194.     fprintf(stderr, "Starting parse\n");
  195.  
  196.   yystate = 0;
  197.   yyerrstatus = 0;
  198.   yychar = YYEMPTY;        /* Cause a token to be read.  */
  199.  
  200.   /* Initialize stack pointers.
  201.      Waste one element of value and location stack
  202.      so that they stay on the same level as the state stack.  */
  203.  
  204.   yyssp = yyss - 1;
  205.   yyvsp = yyvs;
  206.   yylsp = yyls;
  207.  
  208. /* Push a new state, which is found in  yystate  .  */
  209. /* In all cases, when you get here, the value and location stacks
  210.    have just been pushed. so pushing a state here evens the stacks.  */
  211. yynewstate:
  212.  
  213.   *++yyssp = yystate;
  214.  
  215.   if (yyssp >= yyss + yymaxdepth - 1)
  216.     {
  217.       /* Give user a chance to reallocate the stack */
  218.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  219.       YYSTYPE *yyvs1 = yyvs;
  220.       YYLTYPE *yyls1 = yyls;
  221.       short *yyss1 = yyss;
  222.  
  223.       /* Get the current used size of the three stacks, in elements.  */
  224.       int size = yyssp - yyss + 1;